package com.me.model.normal;

import cn.hutool.crypto.digest.DigestUtil;
import com.me.model.Item;
import com.me.model.User;
import com.me.services.ServiceManager;

import java.util.Collection;

/**
 * @author 吕旺平
 * @date 2019/10/15 00:50:09
 * @description
 */
public class NormalUser extends User {
	protected String headPath;
	protected String name;
	protected String mobile;
	protected int sex;
	
	public NormalUser() {
	}

	public NormalUser(String id, String email, String username, String password, String headPath, String name, int sex,String mobile) {
		super(id, email, username, password);
		this.headPath = headPath;
		this.name = name;
		this.sex = sex;
		this.mobile = mobile;
	}
	
	public String getHeadPath() {
		return headPath;
	}
	
	public void setHeadPath(String headPath) {
		this.headPath = headPath;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public int getSex() {
		return sex;
	}
	
	public void setSex(int sex) {
		this.sex = sex;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	@Override
	public int getScore()  {
		return ServiceManager.getItemService().getScore(this);
	}

	@Override
	public Collection<Item> getAllItem()  {
		Collection<Item> items = ServiceManager.getItemService().getAllFromUser(this);
		return items;
	}
}
